/*
 * File:        duplicate.h
 * Authors:     Shaan Mulchandani (ee122-bv) and Jonathan Kotker (ee122-bw)
 * Description: This header file contains an element of the `duplicate list':
 *              a history data structure that keeps track of information
 *              about requests received and messages sent.
 */

#ifndef _DUPLICATE_H
#define	_DUPLICATE_H

#include <sys/socket.h>

struct duplicate {

    /* ID of a message. */
    unsigned long int id;

    /* Source IP address of a message. */
    struct sockaddr server_ip_add;

    /* Copy of the response corresponding to this packet. */
    char stored_response[MAX_BUFFER_SIZE];

    /* Length of the response. */
    int response_length;

    /* Pointer to the next duplicate in the duplicate list. */
    struct duplicate* next;

    /* Pointer to the previous duplicate in the duplicate list. */
    struct duplicate* prev;

};

typedef struct duplicate duplicate;

#endif	/* _DUPLICATE_H */
